<template>
  <hry-header title="余额" :showBackBtn="true">
    <span slot="action" @click="$commonJs.goPage('personBalanceDetail')"
      >明细</span
    >
    <div slot="content" class="home form-wrapper">
      <i class="iconfont iconjinzhu"></i>
      <div class="money-wrapper">
        <span>我的余额</span><br />
        <span class="pay-money"
          ><span class="icon">￥</span>
          <md-amount
            :value="parseFloat(detailInfo.money)"
            :duration="200"
            has-separator
            transition
          ></md-amount
        ></span>
      </div>
      <div>
        <a-button type="primary" @click="$commonJs.goPage('personRecharge')"
          >充值</a-button
        ><br />
        <a-button @click="$commonJs.goPage('personWithdraw')">提现</a-button>
      </div>
    </div>
  </hry-header>
</template>

<script>
import { Amount } from "mand-mobile";
import "@/assets/fonticon/iconfont.css";
export default {
  name: "index",
  components: {
    hryHeader: () => import("@/components/contentWrapper/index"),
    [Amount.name]: Amount
  },
  data() {
    return {
      detailInfo: {
        money: 0
      }
    };
  },
  methods: {
    getData() {
      this.$ajax
        .post(this.$api.getPerson)
        .then(res => {
          this.detailInfo = res.data;
        })
        .catch(err => {
          this.$message.error(err);
        });
    }
  },
  created() {
    this.getData();
  }
};
</script>

<style scoped lang="less">
.form-wrapper {
  text-align: center;
  .money-wrapper {
    font-size: 25px;
  }
  .pay-money {
    .icon {
      font-size: 50px;
    }
    display: inline-block;
    margin-top: 25px;
    margin-bottom: 40px;
    font-size: 60px;
    font-weight: bold;
  }
  .ant-btn {
    display: inline-block;
    width: 64%;
    margin-top: 44px;
    height: 80px;
    font-size: 30px;
  }
  .iconfont {
    color: @primary-color;
    font-size: 168px;
    display: inline-block;
    margin: 60px 0 50px 0;
  }
}
</style>
